package com.ikas.ai.server.common.parser.model;

import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
import lombok.Builder;
import lombok.Data;

import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * @Description: 解析画布元数据
 * @Author: qi.yilai
 * @Date: 2023/1/30 11:47
 * @Version: 1.0.0
 **/
@Builder
@Data
public class AiMaintainMetaData {

    private Map<String, FlowNodeMetaData> nodeMap;

    private List<FlowNodeLineMetaLine> lines;

    public void putFlowNode(FlowNodeMetaData flowNodeMetaData) {
        if (Objects.isNull(nodeMap)) {
            nodeMap = Maps.newHashMap();
        }
        nodeMap.put(flowNodeMetaData.getId(), flowNodeMetaData);
    }
}
